home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PORTABLE.ZIP / INTRFLUS.C < prev    next >
Text File  |  1992-11-21  |  2KB  |  62 lines

  1. #define        CURSES_LIBRARY  1
  2. #include <curses.h>
  3. #undef intrflush
  4.  
  5. #ifndef        NDEBUG
  6. char *rcsid_intrflus = "$Header: c:/curses/portable/RCS/intrflus.c%v 2.0 1992/11/15 03:28:57 MH Rel $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12. /*man-start*********************************************************************
  13.  
  14.   intrflush()  - enable flush on interrupt
  15.  
  16.   X/Open Description:
  17.        If this option is enabled (bf is TRUE), and an interrupt is
  18.        pressed on the keyboard (INTR, BREAK, or QUIT) all output in
  19.        the terminal driver queue will be flushed, giving the effect
  20.        of faster response to the interrupt but causing curses to have
  21.        the wrong idea of what is on the screen.  Disabling the option
  22.        prevents the flush.  The default for the option is inherited
  23.        from the terminal driver settings.  The window argument is
  24.        ignored.
  25.  
  26.   PDCurses Description:
  27.        No additional functionality.
  28.  
  29.   X/Open Return Value:
  30.        The intrflush() function returns OK on success and ERR on error.
  31.  
  32.   X/Open Errors:
  33.        No errors are defined for this function.
  34.  
  35.   Portability:
  36.        PDCurses        int intrflush( WINDOW* win, bool bf );
  37.        X/Open Dec '88  int intrflush( WINDOW* win, bool bf );
  38.        BSD Curses      
  39.        SYS V Curses    
  40.  
  41. **man-end**********************************************************************/
  42.  
  43. int    intrflush( WINDOW *win, bool bf )
  44. {
  45. #ifdef TC
  46. #  pragma argsused
  47. #endif
  48.        int     y;
  49.        int     maxy;
  50.  
  51.        if (win == (WINDOW *)NULL)
  52.                return( ERR );
  53.  
  54.        maxy = win->_maxy - 1;
  55.  
  56.        for (y = 0; y <= maxy; y++)
  57.        {
  58.                win->_firstch[y] = _NO_CHANGE;
  59.        }
  60.        return( OK );
  61. }
  62.